<?php
namespace Api
{
    /**
     * Subpages manager. 
     * @author Lukasz Torba
     */
    class Subpages extends Model\DB2
    {
        /**
         * Return subpages content by alias
         * @param subpage alias
         */
        public function GetByAlias($alias)
        {
            $_Q = $this->db->prepare('SELECT * FROM `subpages` WHERE `alias`=:alias LIMIT 1');
            $_Q->bindValue(':alias',$alias,\PDO::PARAM_STR);
            $_Q->execute();
            
            if( false !== ($result = $_Q->fetchAll()))
            {
                return $result;
            }
            
            return array();
        }
                
    }
}
?>